﻿<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>系统设置</title>
    <link rel="stylesheet" type="text/css" href="~/Content/jquery-easyui-1.4.2/themes/default/easyui.css">
    <link rel="stylesheet" type="text/css" href="~/Content/jquery-easyui-1.4.2/themes/icon.css">
    <link rel="stylesheet" type="text/css" href="~/Content/jquery-easyui-1.4.2/demo.css">
    <link href="~/Content/Styles/Manage_Order.css" rel="stylesheet" />
    <script type="text/javascript" src="~/Content/jquery-easyui-1.4.2/jquery.min.js"></script>
    <script type="text/javascript" src="~/Content/jquery-easyui-1.4.2/jquery.easyui.min.js"></script>
    <script src="~/Content/jquery-easyui-1.4.2/locale/easyui-lang-zh_CN.js"></script>

    <script>
        $(function () {
            // 获取数据
            initTable();
        });

        //根据商户获取对应的表格
        function initTable() {
            $('#shanghuliebiao').datagrid({
                iconCls: 'icon-user',
                loadMsg: '数据加载中...',
                nowrap: true,
                autoRowHeight: true,
                singleSelect: true,
                striped: true,
                url: '/SystemKey/getgrid',
                sortName: 'MerID',
                sortOrder: 'asc',
                border: true,
                remoteSort: false,
                idField: 'MerID',
                pageSize: 20,
                pageList: [20],
                pagination: true,
                rownumbers: true,
                columns: [[
					{ field: 'MerID', title: '商户ID', width: 70, sortable: true, hidden: true },
					{ field: 'MerName', title: '商户名称', width: 70, sortable: true }
                ]],
                toolbar: '#tb1',
            });
        }

        //获取用户信息绑定
        function BingDetails() {
            //var datas = $("#load").datagrid("getSelections")[0];
            //$("#updateid").textbox('setValue', datas.OperID);
            //$("#updatenum").textbox('setValue', datas.OperNum);
            //$("#updatepwd").textbox('setValue', datas.OperPW);
            //$("#updateintime").textbox('setValue', datas.OperInTime);
            //$("#updateouttime").textbox('setValue', datas.OperOutTime);
            //$("#updatetype").textbox('setValue', datas.OperType);
            //$("#updaterole").textbox('setValue', datas.RoleName);
            //$("#updatestate").textbox('setValue', datas.OperState);


        }

        //修改用户绑定事件
        function BindUpdateOperClickEvent() {
            $("#btnUpdate").click(function () {
                //首先判断前台的验证是否通过
                var valid = $('#updateController').form('validate');
                if (valid == false) {
                    return false;
                }
                //创建传递的参数
                var postdata = {
                    OperID: $("#updateid").val(),
                    OperNum: $("#updatenum").val(),
                    OperPw: $("#updatepwd").val(),
                    OperInTime: $("#updateintime").val(),
                    OperOutTime: $("#updateouttime").val(),
                    OperType: $("#updatetype").val(),
                    OperRole: $("#updaterole").val(),
                    OperRole: $("#updatestate").val(),
                    DepPower: "000"
                };
                //使用异步实现修改用户信息
                $.post("/SystemKey/UpdateOper", postdata, function (date) {
                    if (date == "OK") {
                        // 刷新界面
                    }
                    else {
                        alert("修改失败，请检查");
                    }
                });
            });
        }
    </script>

</head>
<body style="padding: 0;">
    <div class="easyui-dialog" style="width: 550px; padding: 10px 0"
        closed="true" resizable="true" modal="true" buttons="#dlg-buttons" align="center">
        <form id="updateController" action="/SystemKey/UpdateOper" method="post" novalidate="novalidate">
            <ul style="margin-bottom: 30px;">
                <li class="info-li" style="margin-top: 10px">
                    <div class="info-li-first fl"></div>
                    <div class="info-li-second fl">
                        <input id="cb_jifen" type="checkbox" />是否允许商户开启积分
                    </div>
                </li>
                <li class="info-li" style="margin-top: 10px">
                    <div class="info-li-first fl"></div>
                    <div class="info-li-second fl">
                        <input id="cb_ptjifen" type="checkbox" />是否允许平台积分消费
                    </div>
                </li>
                <li class="info-li" style="margin-top: 10px">
                    <div class="info-li-first fl"></div>
                    <div class="info-li-second fl">
                        <input id="Checkbox4" type="checkbox" />是否允许商户积分消费
                    </div>
                </li>
                <li class="info-li" style="margin-top: 10px">
                    <div class="info-li-first fl"></div>
                    <div class="info-li-second fl">
                        <input id="cb_pinglun" type="checkbox" />是否允许评论
                    </div>
                </li>
                <li class="info-li">
                    <div class="info-li-first fl">商户排位设置：</div>
                    <div class="info-li-second fl">
                        <select id="Select1">
                            <option>自定义</option>
                            <option>消费总数</option>
                            <option>浏览总数</option>
                            <option>销售总额</option>
                            <option>评论总数</option>
                        </select>
                    </div>
                </li>
                <li class="info-li">
                    <div class="info-li-first fl"></div>
                    <div class="info-li-second fl">
                        <table id="shanghuliebiao">
                        </table>
                    </div>
                </li>
                <li class="info-li">
                    <div class="info-li-first fl">&nbsp;</div>
                    <div class="info-li-second fl">
                        <a id="btnUpdate" href="javascript:(0)"
                            class="easyui-linkbutton" data-options="iconCls:'icon-add'">修改</a>
                    </div>
                </li>
            </ul>
        </form>
    </div>

</body>
</html>

